/**
  ******************************************************************************
  * @文件     spiflash.h
  * @作者     hero_cao
  * @版本     V1.0.0
  * @日期     2025/06/14
  * @概要     spiflash初始化库
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __SPI_FLASH_H_
#define __SPI_FLASH_H_

/* Includes ------------------------------------------------------------------*/
#include <stdint.h>

/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
uint32_t flash_spi_getid(void);
uint32_t flash_spi_init(void);
void flash_spi_write(uint8_t *pbuf, uint32_t addr, uint16_t datalen);
void flash_spi_read(uint8_t *pbuf, uint32_t addr, uint16_t datalen);
void flash_spi_erase_chip(void);
void flash_spi_erase_sector(uint32_t sectoraddr);

#endif /* __SPI_FLASH_H_ */

